package com.jnu.HomeworkApplication.data;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

public class Note {
    float x;
    float y;
    float maxHeight;

    public Note(float x,float y,float maxHeight){
        this.x=x;
        this.y=y;
        this.maxHeight=maxHeight;
    }

    public void drawNote(Canvas canvas){
        Paint paint =new Paint();
        paint.setColor(Color.BLUE);

        canvas.drawRect(x,y,x+200,y+100,paint);
    }

    public boolean MoveNote(){
        return y <= maxHeight;
    }

    public float getY(){
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public boolean isHit(float touchedX,float touchedY){
        return touchedX < x + 200 && touchedX > x && touchedY < y + 100 && touchedY > y && y > 500;
    }

}
